﻿#include <iostream>
using namespace std;

void reverse(int a[], int n) {
	for (int i = 0; i < n / 2; i++) {
		int t = a[i];
		a[i] = a[n - 1 - i];
		a[n - 1 - i] = t;
	}
}

int main() {
	int a[] = { 1,2,3,4,5 };

	reverse(a, 5);

	for (int i = 0; i < 5; i++) { 
		cout << "a[" << i << "]=" << a[i] << endl;
	}

	cin.get();
}